package com.itnoob.demo1;

/**
 * @author zhoujun
 * @date 2025/3/21 21:45
 */
public class Client {
    public static void main(String[] args) {
        //创建几个ConcreteCoffee对象,表示不同的咖啡和样式(内部状态和外部状态)
        CoffeeFactory coffeeFactory = new CoffeeFactory();
        CoffeeStyle style1 = new CoffeeStyle("大杯", "热");
        CoffeeStyle style2 = new CoffeeStyle("中杯", "冰");
        CoffeeStyle style3 = new CoffeeStyle("小杯", "温");

        //通过coffeeFactory对象获取或者创建咖啡对象,并传入不同的样式(外部状态)
        Coffee coffee1 = coffeeFactory.getCoffee("拿铁", 20.0);
        coffee1.disPlay();
        System.out.println("style1:" + style1);

        Coffee coffee2 = coffeeFactory.getCoffee("卡布基诺", 22.0);
        coffee2.disPlay();
        System.out.println("style:" + style2);

        Coffee coffee3 = coffeeFactory.getCoffee("拿铁", 20.0);
        coffee3.disPlay();
        System.out.println("style:" + style3);


    }
}
